package kr.hkit.powerjava.chapter24.work;

import java.io.Serializable;

public class Student implements Serializable{
	private int stdNum;
	private String stdName;
	private int kor;
	private int math;
	private int eng;
	public int getEng() {
		return eng;
	}
	public void setEng(int eng) {
		this.eng = eng;
	}
	public Student(int stdNum, String stdName, int kor, int math, int eng) {
		super();
		this.stdNum = stdNum;
		this.stdName = stdName;
		this.kor = kor;
		this.math = math;
		this.eng = eng;
	}
	public Student(int stdNum, String stdName) {
		super();
		this.stdNum = stdNum;
		this.stdName = stdName;
	}
	public int totalScore(){
		return kor+eng+math;
	}
	public double avgScore(){
		return totalScore()/3.0;
	}
	@Override
	public String toString() {
		return String
				.format("%3s\t%10s\t%3s\t%3s\t%3s\t%3s\t%6.2f",
						stdNum, stdName, kor, math, eng, totalScore(),
						avgScore());
	}
}
